﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TwitterAppender
{
    public static class Extensions
    {
        private const int MAXIMUM_TWEET_LENGTH = 140;

        public static string ToTweet(this string fromString_)
        {
            if (fromString_ == null || fromString_.Length < MAXIMUM_TWEET_LENGTH)
                return fromString_;

            return (fromString_.Substring(0, MAXIMUM_TWEET_LENGTH - 3) + "...");
        }
    }
}
